<template>
	<view class="content">
		<view v-for="(item,index) in list">
			<view class="title">
				<view>{{item.title}}</view>
				<view class="more-btn">查看更多>></view>
			</view>
			<view class="video-list">
				<view class="video-item" v-for="(item1,index1) in item.list">
					<view class="pic-img">
						<u--image :src="item1.picImg" :lazy-load="true"></u--image>
					</view>
					<view class="video-title">{{item1.name}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			};
		},
		onLoad(option) {
			// console.log(option.type)
			this.getList()
		},
		methods: {
			getList() {
				this.$dataRequest.getIndexData((res) => {
					this.list = res
				}, (error) => {
					console.log(error)
				})
			},
		}
	}
</script>

<style lang="scss">
	.content {
		.title {
			padding-left: 10rpx;
			padding-right: 10rpx;
			height: 80rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;

			.more-btn {
				color: red;
			}
		}

		.video-list {
			margin-left: 20rpx;
			margin-right: 20rpx;
			display: flex;
			flex-wrap: wrap;
			flex-direction: row;
			justify-content: space-between;

			.video-item {
				width: calc(50% - 5px);
				overflow: hidden;
				margin-bottom: 20rpx;

				.pic-img {
					aspect-ratio: 2/3;
					overflow: hidden;
				}

				.video-title {
					margin-top: 10rpx;
					overflow: hidden;
					text-overflow: ellipsis;
					display: -webkit-box;
					-webkit-box-orient: vertical;
					-webkit-line-clamp: 2;
				}
			}
		}

	}
</style>